//
//  LRJ_CTextLayout+TransPointOrRect.m
//  LRJAansyDraw
//
//  Created by imac_LRJ on 2022/6/19.
//

#import "LRJ_CTextLayout+TransPointOrRect.h"

@implementation LRJ_CTextLayout (TransPointOrRect)
- (CGPoint)wmg_CTPointFromUIPoint:(CGPoint)point
{
    point.y = self.size.height - point.y;
    return point;
}

- (CGPoint)wmg_UIPointFromCTPoint:(CGPoint)point
{
    point.y = self.size.height - point.y;
    return point;
}

- (CGRect)wmg_CTRectFromUIRect:(CGRect)rect
{
    rect.origin = [self wmg_CTPointFromUIPoint:rect.origin];
    rect.origin.y -= rect.size.height;
    return rect;
}

- (CGRect)wmg_UIRectFromCTRect:(CGRect)rect
{
    rect.origin = [self wmg_UIPointFromCTPoint:rect.origin];
    rect.origin.y -= rect.size.height;
    return rect;
}
@end
